package com.scc.mapper;

import com.scc.pojo.AdminOperationLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface AdminOperationLogMapper {
    //添加管理员操作日志进入数据库的方法
    @Insert("insert into adminoperationlog (adminId, account, rights, className, methodName, methodParams, resultValue, costTime,operateTime) value " +
            "(#{adminId},#{account},#{rights},#{className},#{methodName},#{methodParams},#{resultValue},#{costTime},#{operateTime})")
    void insertAdminOperationLog(AdminOperationLog operationLog);

    //查询或者获取管理员日志信息的方法
    List<AdminOperationLog> getAdminOperationLogs(@Param("username") String username, @Param("adminRights") String adminRights, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    //高级管理员对日志的删除操作
    void deleteAdminOperationLogs(@Param("ids") List<Integer> ids);
}
